﻿<phone:PhoneApplicationPage 
    x:Class="WPtrakt.Settings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
    <Grid x:Name="LayoutRoot" Opacity="0">
        <controls:Panorama Margin="0,12,0,0" Name="SettingsPanorama">
            <controls:PanoramaItem Header="Images" Width="480">
                <StackPanel>
                    <ListBox Height="720" HorizontalAlignment="Left" Name="listBoxLiveTile" VerticalAlignment="Top" Width="439" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        <ListBoxItem>
                            <toolkit:ToggleSwitch Foreground="{StaticResource PhoneForegroundBrush}" Checked="toggleWallpaper_Checked_1" Unchecked="toggleWallpaper_Unchecked_1"   x:Name="toggleWallpaper" Content="Enabled" IsChecked="true"  Header="Background Wallpaper" Height="120" Width="420" />
                        </ListBoxItem>
                        <ListBoxItem Height="20"></ListBoxItem>
                        <ListBoxItem Margin="0 -15">
                            <toolkit:ToggleSwitch x:Name="toggleSmallScreens" Foreground="{StaticResource PhoneForegroundBrush}"  Content="Enabled" IsChecked="true"  Header="Small Screenshots" Height="120" Width="420" Checked="toggleSmallScreens_Checked_1" Unchecked="toggleSmallScreens_Unchecked_1" />
                        </ListBoxItem>
                        <ListBoxItem Height="20"></ListBoxItem>
                        <ListBoxItem Margin="0 -15">
                            <toolkit:ToggleSwitch x:Name="toggleWifi" Foreground="{StaticResource PhoneForegroundBrush}"  Content="Enabled" IsChecked="true"  Header="Show images anyway on WiFi" Height="120" Width="420" Checked="toggleWifi_Checked_1" Unchecked="toggleWifi_Unchecked_1" />
                        </ListBoxItem>
                    </ListBox>
                </StackPanel>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="Cache" Width="480">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Style="{StaticResource PhoneTextLargeStyle}" Text="Current usage:" />
                        <TextBlock Style="{StaticResource PhoneTextLargeStyle}" Text="{Binding Usage}" />
                    </StackPanel>
                    <Button Name="ClearCacheButton" IsEnabled="False" Margin="0 20" Content="Clear Cache" Width="200" Click="ClearCacheButton_Click"/>
                    <TextBlock HorizontalAlignment="Center" Margin="0 50" Text="{Binding DebugInfo}"/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock TextDecorations="Underline" Text="Cache:" Width="114" />
                        <TextBlock Margin="10 2" Height="97"  Text="The cache contains all the images downloaded from trakt (Posters, backgrounds, ...)" TextWrapping="Wrap" Width="300" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock TextDecorations="Underline" Text="Debug Info:" Width="114" />
                        <TextBlock Margin="10 2" Height="114"  Text="Since this application has quite a few images. This debug info is here untill the next version to keep the usage in check." TextWrapping="Wrap" Width="300" />
                    </StackPanel>
                </StackPanel>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="Live Tile" Width="480">
                <StackPanel>
                    <ListBox Height="720" HorizontalAlignment="Left" VerticalAlignment="Top" Width="439" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        <ListBoxItem>
                            <toolkit:ToggleSwitch Foreground="{StaticResource PhoneForegroundBrush}"   Checked="toggle_Checked"  Unchecked="toggle_Unchecked" x:Name="toggle" Content="Disabled" IsChecked="false"  Header="Live Tile" Height="120" Width="420" />
                        </ListBoxItem>
                        <ListBoxItem>
                            <toolkit:ToggleSwitch x:Name="toggleRandom" Foreground="{StaticResource PhoneForegroundBrush}"  Content="Disabled" IsChecked="false"  Header="Randomise" Checked="toggleRandom_Checked_1" Unchecked="toggleRandom_Unchecked_1" Height="120" Width="420" />
                        </ListBoxItem>
                        <ListBoxItem Height="80"></ListBoxItem>
                        <ListBoxItem >
                            <TextBlock VerticalAlignment="Top" Margin="10 0"  Text="A random episode in the next week appears every 30 mins, otherwise the next episode in line is shown." TextWrapping="Wrap" Width="420" />
                        </ListBoxItem>
                        <ListBoxItem Height="50"></ListBoxItem>
                        <ListBoxItem>
                            <TextBlock VerticalAlignment="Top" Margin="10 0"  Text="When a show/episode has been viewed inside the application, the background image shown will be used in the live tile. If it has not been viewed inside the app, the default WPtrakt image will be shown." TextWrapping="Wrap" Width="420" />
                        </ListBoxItem>
                    </ListBox>
                </StackPanel>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="Live Wallpaper" Width="480">
                <StackPanel>
                    <ListBox Height="720" HorizontalAlignment="Left" Name="listBoxWallpaper" VerticalAlignment="Top" Width="439" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        <toolkit:ListPicker Header="Live Wallpaper Update Schedule" Background="{StaticResource PhoneBackgroundBrush}" ExpansionMode="FullscreenOnly" Margin="0 0 0 0" Height="100" Foreground="{StaticResource PhoneAccentBrush}" BorderBrush="{StaticResource PhoneBackgroundBrush}" Name="WallpaperSetting" SelectionChanged="WallpaperSetting_SelectionChanged_1">
                            <sys:String>Together with live tile</sys:String>
                            <sys:String>Every 6 hours</sys:String>
                            <sys:String>Every 24 hours</sys:String>
                            <toolkit:ListPicker.FullModeItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Margin="16 21 0 20">
                                        <TextBlock Text="{Binding}"
                                       Margin="0 0 0 0"
                                       FontSize="43" 
                                       FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </toolkit:ListPicker.FullModeItemTemplate>
                        </toolkit:ListPicker>
                        <ListBoxItem>
                            <Button Content="Go to lock screen settings" Name="LockScreenSettings" HorizontalAlignment="Center" Click="LockScreenSettings_Click_1"/>
                        </ListBoxItem>
                        <ListBoxItem Height="80"></ListBoxItem>
                        <ListBoxItem >
                            <TextBlock VerticalAlignment="Top" Margin="10 0"  Text="The wallpaper will be updated only when the live tile has been enabled. (It does not have to be pinned to start to work)" TextWrapping="Wrap" Width="420" />
                        </ListBoxItem>
                        <ListBoxItem Height="50"></ListBoxItem>
                        <ListBoxItem >
                            <TextBlock VerticalAlignment="Top" Margin="10 0"  Text="Images are fetched the same way as the live tile. Please visit the shows inside the application to download the wallpaper image." TextWrapping="Wrap" Width="420" />
                        </ListBoxItem>
                    </ListBox>
                </StackPanel>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="About" Width="480">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Style="{StaticResource PhoneTextLargeStyle}" Text="Version:" />
                        <TextBlock Style="{StaticResource PhoneTextLargeStyle}" Text="{Binding Version}" />
                    </StackPanel>
                    <StackPanel Orientation="Vertical" Margin="0 50">
                        <TextBlock Style="{StaticResource PhoneTextLargeStyle}" Text="Support:" />
                        <TextBlock Foreground="CadetBlue" TextDecorations="Underline" Style="{StaticResource PhoneTextLargeStyle}" Text="wptrakt@outlook.com" Tap="TextBlock_Tap"/>
                        <TextBlock Margin="50 20"  Foreground="CadetBlue" Name="Twitter" TextDecorations="Underline" Style="{StaticResource PhoneTextLargeStyle}" Text="@theunenth" Tap="Twitter_Tap_1"/>
                    </StackPanel>
                </StackPanel>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>
</phone:PhoneApplicationPage>